<%--
  Created by IntelliJ IDEA.
  User: tc
  Date: 2024/1/7
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<script>
    $(function () {
        $("tr:odd").css("background", "pink");
    })
</script>

<body>
<table class="table" width="700px">
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>日期</th>
    </tr>

    <c:forEach items="${list}" var="u">

        <tr>
            <td>${u.id}</td>
            <td>${u.name}</td>
            <td>${u.age}</td>
            <td>${u.hiredate}</td>
        </tr>
    </c:forEach>
</table>
<button type="button" id="addbtn" class="btn btn-danger">添加用户</button>
<script>
    $(function () {
        $("#addbtn").click(function () {
            location.href = "add.jsp";
        });
    })
</script>

</body>
</html>
